<%@ page import="cn.tedu.web.fqmz.JdbcUtils" %>
<%@ page import="cn.tedu.web.fqmz.User" %>
<%@ page import="java.util.List" %>
<%@ page import="cn.tedu.web.fqmz.Goods" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java实训团队协作简单案例</title>
    <link rel="shortcut icon" href="assets/img/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="assets/vendors/font-awesome-4.7.0/css/font-awesome.min.css" />
    <link rel="stylesheet" href="assets/css/core.css" />
    <link rel="stylesheet" href="assets/css/index.css" />

    <link rel="stylesheet" href="assets/css/welcome.css" />
</head>

<body>
<jsp:include page="/WEB-INF/tpl/fqmz/header.jsp"/>
    <section class="container">
        <jsp:include page="/WEB-INF/tpl/fqmz/side.jsp"/>
        <div class="main-right">
            <%
                Object uid = session.getAttribute("UID");
                String sql = "SELECT `name` FROM `user` WHERE id = ?";
                String  id = JdbcUtils.select(sql, String.class, uid);
            %>
            <h3>欢迎您，<%=id%> </h3>
            <div class="summary-container">
                <div class="summary-category">
                    <div class="summary-desc">
                        <span class="summary-title">分类总数</span>
                        <span class="summary-value">20</span>
                    </div>
                    <div class="summary-icon">
                        <i class="fa fa-star-o"></i>
                    </div>
                </div>
                <div class="summary-goods">
                    <div class="summary-desc">
                        <span class="summary-title">商品总数</span>
                        <%
                            String sql2 = "SELECT `id` FROM `goods`";
                            List<Goods> g_m = JdbcUtils.selects(sql2, Goods.class);
                        %>
                        <span class="summary-value"><%=g_m.size()%></span>
                    </div>
                    <div class="summary-icon">
                        <i class="fa fa-bars"></i>
                    </div>
                </div>
                <div class="summary-user">
                    <div class="summary-desc">
                        <span class="summary-title">用户总数</span>
                        <%
                            String sql3 = "SELECT `id` FROM `user`";
                            List<User> u_m = JdbcUtils.selects(sql3, User.class);
                        %>
                        <span class="summary-value">6</span>
                    </div>
                    <div class="summary-icon">
                        <i class="fa fa-users"></i>
                    </div>
                </div>
            </div>
        </div>
    </section>
</body>

</html>